#ifndef _IMMDATA_H_
#define _IMMDATA_H_
#include "CompositionStringClass.h"
#include "CandidateStringClass.h"

class ImmData
{
private:
	HIMC hIMC;
	LPINPUTCONTEXT lpIMC;
	LPCOMPOSITIONSTRING lpCompStr;	
	LPCANDIDATEINFO lpCandInfo;
	BOOL lockOK;
	CompositionStringClass* lpCompStrClass;
	CandidateStringClass* lpCandStrClass;
private:
	static BOOL IMM_CompStartSend;
public:
	ImmData(HIMC hIMC);
	BOOL MakeResultString(LPDWORD lpdwTransKey,BOOL fFlag);
	BOOL GenerateMessage(LPDWORD lpdwTransKey,LPGENEMSG lpGeneMsg);
	BOOL GenerateMessageToTransKey(LPDWORD lpdwTransKey,LPGENEMSG lpGeneMsg) CONST;
	BOOL IsCompStr() CONST;
	VOID WM_StartComp(LPDWORD lpdwTransKey);
	VOID WM_EndComp(LPDWORD lpdwTransKey);
	VOID WM_CompStr(LPDWORD lpdwTransKey);
	VOID WM_CompResult(LPDWORD lpdwTransKey);
	VOID WM_OpenStatus(LPDWORD lpdwTransKey);
	VOID WM_SetStatusOpen(LPDWORD lpdwTransKey);
	VOID SendTextToApp(LPDWORD lpdwTransKey,CONST LPTSTR pText);
	CompositionStringClass* GetCompStrClass();
	CandidateStringClass* GetCandStrClass();
	VOID SetImmOpen(BOOL state);
	VOID ToggleImmOpenState();
	BOOL GetImmOpenState() CONST;
	VOID Initial();
	VOID OutputCompString(LPDWORD lpdwTransKey);
	BOOL LockImmOK() const;
	~ImmData();
private:
	BOOL _lockIMM();
	VOID _unLockIMM();
public:
	static BOOL IsIMEMessage(UINT message);
};
#endif
